package model

import (
	"gorm.io/gorm"
	"time"
)

type Chat struct {
	Id        uint64         `gorm:"column:id;type:bigint(20) UNSIGNED;primaryKey;not null;" json:"id"`
	DoctorId  uint64         `gorm:"column:doctor_id;type:bigint(20) UNSIGNED;comment:医生编号;not null;" json:"doctor_id"` // 医生编号
	UserId    uint64         `gorm:"column:user_id;type:bigint(20) UNSIGNED;comment:用户编号;not null;" json:"user_id"`     // 用户编号
	ImagesUrl string         `gorm:"column:images_url;type:varchar(255);comment:图片url;not null;" json:"images_url"`     // 图片url
	Message   string         `gorm:"column:message;type:varchar(30);comment:聊天内容;not null;" json:"message"`             // 聊天内容
	CreatedAt time.Time      `gorm:"column:created_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"created_at"`
	UpdatedAt time.Time      `gorm:"column:updated_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"updated_at"`
	DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;type:datetime(3);default:NULL;" json:"deleted_at"`
}

func (c *Chat) TableName() string {
	return "chat"
}
